
const first = new Promise((resolve,reject)=>{
    setTimeout(resolve, 0, '兑现(first)');
});
first.then( result => console.log( 'first then: ', result ) );

const second = new Promise((resolve,reject)=>{
    setTimeout(resolve, 1000, '兑现(second)');
});
second.then( result => console.log( 'second then: ', result ) );

const third = new Promise((resolve,reject)=>{
    setTimeout(resolve, 500, '兑现(third)');
});
third.then( result => console.log( 'third then: ', result ) );

const promises = [ first, second, third ];

const last = Promise.any( promises );
last.then( results => console.log( results ) )
    .catch( reason => console.log( reason ) );

// 总结:
// Promise.any( iterable )
// 只要参数 iterable 中有一个Promise实例被兑现，则any返回的Promise实例就被兑现
// 当参数 iterable 中所有的 Promise实例都被拒绝时，any返回的Promise实例被拒绝